import http from "@utils/request";


import { IDictRequest, IDictList, IDictForm, IDictFormAdd, IDictFormInfo } from "@interface/dict_item";

//字典项列表
export const dictPage = (data: IDictForm): Promise<IDictList> => {
    return http.get<IDictList>('/system_dict_item/page', data)
}

//添加字典项
export const dictAdd = (data: IDictFormAdd): Promise<IDictRequest> => {
    return http.post<IDictRequest>('/system_dict_item/', data)
}


//字典项详情
export const dictGet = (data: string): Promise<IDictRequest> => {
    return http.get<IDictRequest>(`/system_dict_item/${data}`)
}



//修改字典项
export const dictUpdate = (data: IDictFormInfo): Promise<IDictRequest> => {
    return http.put<IDictRequest>('/system_dict_item/', data)
}



//删除字典项
export const dictDel = (data: string): Promise<IDictRequest> => {
    return http.delete<IDictRequest>(`/system_dict_item/${data}`)
}